<?php
require_once '../sub/init.php';
if (!ifint($aid))zeaialert('{"title":"记录不存在","btnt":"我知道了","url":"-1"}');
require_once ZEAI.'sub/conn.php';
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'cache/config_index.php';

if($t!='hn' && $t!='u')$t='u';



$nodatatips="<div class='nodatatips'><i class='ico7'>&#xe608;</i>暂时木有内容呀～～</div>";
function rows_ulist($rows,$p,$n=1) {
	global $_ZEAI,$_INDEX,$cook_uid,$cook_sex,$cook_grade,$zeai_cn,$t;
	//
	$switch = json_decode($_ZEAI['switch'],true);
	$blurclass = '';$lockstr = '';$ifblur=0;
	if($switch['grade1LockBlur']==1 && intval($cook_grade)<=1){
		$lockstr = '<i class="ico lockico">&#xe61e;</i><div class="lockstr">'.dataIO($switch['grade1LockBlurT'],'out').'</div>';
		$ifblur=1;
		$photo_b = 'blur';
	}else{
		$photo_b = ($_INDEX['waterfall_photo']=='b')?'b':'m';
	}
	//
	$uid           = $rows['id'];
	$sex           = $rows['sex'];
	$grade         = $rows['grade'];
	$photo_s       = $rows['photo_s'];
	$photo_f       = $rows['photo_f'];
	$heigh         = $rows['heigh'];
	$age = getage($rows['birthday']);
	$RZ  = $rows['RZ'];$RZarr = explode(',',$RZ);
	$pay = $rows['pay'];
	$photo_ifshow = $rows['photo_ifshow'];
	$age_str = ($age>18)?$age.'岁':'';
	if(empty($pay) && empty($age) && empty($heigh)){
		$ifdata = false;
	}else{
		//$pay_str = udata('pay',$pay).'/月';
		$job_str = udata('job',$rows['job']);
		$heigh_str = udata('heigh',$heigh);
		$ifdata = true;
	}
	//
	if($photo_ifshow==0 && $ifblur==0){
		$lockstr = '';
		$photo_b_url=RES.'photo_m'.$sex.'_hide.png';
	}else{
		$photo_b_url = (!empty($photo_s) && $photo_f==1)?UP.smb($photo_s,$photo_b):RES.'photo_m'.$sex.'.png';	
	}
	//
	$echo .= '<a uid="'.$uid.'" sex="'.$sex.'" href="'.a('{"kind":"u","uid":"'.$uid.'"}').'"><img class="small_big" src="'.$photo_b_url.'" />';
	$echo .= '<div class="uinfo">';
	//$echo .= '<div class="nik"><span>'.uicon($sex.$grade).$uid.'</span></div>';
	if($ifdata)$echo.= '<div class="data"><span>'.$age_str.'·'.$heigh_str.'</span><span>'.$job_str.$pay_str.'</span></div>';
	$echo .= '</div>';
	if(@count($RZarr)>1)$echo.= '<img src="'.RES.'m/img/rzj.png" class="rzj">';

	//if (!empty($RZ))$echo.= '<div class="payrz">'.RZ_html($RZ,'s','color').'</div>';
	$echo.= $lockstr.'</a>';
	
	if($n % 3 == 0)$echo.= '<div class="clear"></div>';
	
	return $echo;
}
$_ZEAI['pagesize']= 9;$_ZEAI['limit']=999999;

switch ($t) {
	case 'u':
		$ZEAI_SQL = " flag=1 AND photo_f=1";// AND dataaflag=1
		$ZEAI_SELECT="SELECT id,sex,grade,photo_s,photo_f,RZ,birthday,pay,job,heigh,photo_ifshow,crm_flag FROM ".__TBL_USER__." WHERE ".$ZEAI_SQL." ORDER BY refresh_time DESC,id DESC";
	break;
	case 'hn':
		$ZEAI_SQL = "a.senduid=".$cook_uid." AND a.uid=b.id";
		$ZEAI_SELECT="SELECT a.id,a.uid,b.nickname,b.sex,b.grade,b.photo_s,b.photo_f,b.areatitle,b.birthday,b.heigh".$GZSQL." FROM ".__TBL_CLICKHISTORY__." a,".__TBL_USER__." b WHERE ".$ZEAI_SQL." ORDER BY a.addtime";
	break;
}
$ZEAI_total = $db->COUNT(__TBL_USER__,$ZEAI_SQL);
$ZEAI_totalP= ceil($ZEAI_total/$_ZEAI['pagesize']);

if($submitok=='ZEAI_list'){exit(Zeai_ajax_list_fn($ZEAI_totalP,$p));}

$row = $db->ROW(__TBL_CRM_AGENT__,"title,content,address,worktime,tel,path_s,ewm","flag=1 AND id=".$aid);
if ($row){
	$title   = trimhtml(dataIO($row['title'],'out'));
	$content = dataIO($row['content'],'out');
	$address = dataIO($row['address'],'out');
	$worktime = dataIO($row['worktime'],'out');
	$tel      = dataIO($row['tel'],'out');
	$path_s   = $row['path_s'];
	$ewm      = $row['ewm'];
	$path_s_url=(empty($ewm))?RES.'noP.gif':UP.smb($path_s,'b');
	$ewm_url   =(empty($ewm))?RES.'noP.gif':UP.smb($ewm,'b');
}
$db->query("UPDATE ".__TBL_CRM_AGENT__." SET click=click+1 WHERE id=".$aid);
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $title;?>-<?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
</head>
<body>
<style>
.agent_detail_tab a.ed{color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.agent_detail_tab a.ed:after,#backtop a, .btmKefuBtn{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
body{background-color:#fff}

header{width:100%;height:50px;background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;position:fixed;top:0;z-index:1;left:0}
header em{width:-webkit-calc(100% - 140px);line-height:50px;height:50px;margin:0 auto;color:#fff;font-size:18px}
header a{width:50px;height:50px;text-align:center;position:absolute;top:0}
header a i{width:50px;height:50px;line-height:50px;font-size:22px;color:#fff}
header a:first-child{left:0;}
header a:last-child{right:0;}


.bnr{width:100%;height:200px;position:relative;top:50px;overflow:hidden}
.bnr ul{width:100%;height:200px;position:absolute;left:0;top:0;content:''overflow:hidden}
.bnr ul img{width:100%}

.navggbox{width:100%;margin:20px auto 1px auto;position:relative;z-index:-3;background-color:#fff;padding:30px 0 45px}
.agent_nav{width:94%;height:160px;margin:20px auto 0 auto}
.agent_nav a{width:25%;margin-bottom:20px;display:inline-block;text-align:center;float:left}
.agent_nav a i{width:50px;height:50px;line-height:50px;border-radius:35px;display:inline-block;color:<?php echo $_ZEAI['mob_mbcolor'];?>;font-size:29px;border:<?php echo $_ZEAI['mob_mbcolor'];?> 0px solid;background-color:#FFF1F1;background-color:rgba(<?php echo c16_rgb($_ZEAI['mob_mbcolor']);?>,.08);}
.agent_nav a i.about{font-size:26px}
.agent_nav a span{width:60px;display:block;margin:8px auto 0 auto}
.sea{position:absolute;left:0;bottom:-1px;width:100%}


.box{width:100%;background-color:#f8f8f8;min-height:80px;padding:12px 15px 0 15px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.box h1{font-size:20px;text-align:center;font-weight:bold;padding:10px 0 0}
.box h1 b{height:3px;width:20px;background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;border-radius:4px;display:block;margin:5px auto}
.box .iubtn{margin-bottom:5px}
.box .iubtn a{display:inline-block;padding:0 15px;color:#666;font-size:16px;font-weight:normal;line-height:32px;border-radius:20px;border:#f2f2f2 1px solid;background-color:#fff;margin:10px 3% 0 3%}
.box .iubtn a.ed{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;color:#fff;font-weight:bold}
.box h5{width:80%;margin:0 auto 15px auto;color:#666}
/*iubox*/
.agent_detail_u {top:0px;width:100%;position:relative;padding-top:15px}
.agent_detail_u a{display:block;width:33%;float:left;position:relative;}
.small_big{-webkit-animation-duration:0.5s;animation-duration:0.5s}
.agent_detail_u a img.small_big {width:94%;margin:0 auto;display:block;border-radius:5px 5px 0 0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.agent_detail_u a .uinfo{width:94%;margin:0 auto;margin-bottom:25px;padding-bottom:1px;background-color:#fff;border-radius:0 0 5px 5px;text-align:left;color:#666;border-top:0;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-shadow:0 1px 5px rgba(0,0,0,0.1)}
.agent_detail_u a .uinfo .data{padding:6px;margin:0px auto;line-height:20px;height:40px;font-size:14px;text-align:center}
.agent_detail_u a .uinfo .data span{display:block;font-size:14px;line-height:20px}
.agent_detail_u a .uinfo .data i.ico{color:#49BEF5;display:inline-block;margin-right:2px}
.agent_detail_u a .payrz{width:15px;line-height:14px;position:absolute;top:0;right:12px;border-radius:3px}
.agent_detail_u a .payrz  i{display:block;border-radius:3px;margin:5px 0;padding:1px}
.agent_detail_u a i.lockico{display:block;position:absolute;top:23%;left:-webkit-calc(50% - 23px);line-height:50px;font-size:50px;color:#fff;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5}
.agent_detail_u a .lockstr{position:absolute;top:-webkit-calc(23% + 60px);color:#fff;width:100%;filter:alpha(opacity=50);-moz-opacity:0.5;opacity:0.5}
.agent_detail_u a .vipj{width:22px;height:22px;display:block;position:absolute;top:1%;left:5%}
.agent_detail_u a .rzj{width:54px;height:50px;display:block;position:absolute;top:-2px;left:2%}
</style>
<header>
    <a id="topback" onClick="zeai.back();"><i class="ico">&#xeaca;</i></a>
    <em><?php echo $title;?></em>
    <a id="sss"><i class="ico">&#xe64c;</i></a>
</header>
<div class="bnr">
	<ul>
    	<li><img src="<?php echo $path_s_url;?>"></li>
    </ul>
</div>

<div class="clear"></div>
<div class="navggbox">
    <div class="agent_nav">
        <a href="my_hongniang.php?t=qx&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico nan">&#xe637;</i></em><span>最新男生</span></a>
        <a href="my_hongniang.php?t=qx&f=2&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico lv">&#xe639;</i></em><span<?php echo ($f == 2)?' class="zeaicolor"':'';?>>最新女生</span></a>
        <a href="my_hongniang.php?t=qx&f=1&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico cert">&#xe668;</i></em><span<?php echo ($f == 1)?' class="zeaicolor"':'';?>>实名专区</span></a>
        <a href="my_hongniang.php?t=qx&f=-1&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico ">&#xe695;</i></em><span<?php echo ($f == -1)?' class="zeaicolor"':'';?>>交友活动</span></a>
        <a href="my_hongniang.php?t=qx&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico about">&#xe71a;</i></em><span>门店介绍</span></a>
        <a href="my_hongniang.php?t=qx&f=2&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico about">&#xe611;</i></em><span<?php echo ($f == 2)?' class="zeaicolor"':'';?>>服务说明</span></a>
        <a href="my_hongniang.php?t=qx&f=1&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico cert">&#xe657;</i></em><span<?php echo ($f == 1)?' class="zeaicolor"':'';?>>门店动态</span></a>
        <a href="my_hongniang.php?t=qx&f=-1&jumpurl=<?php echo $jumpurl;?>"><em><i class="ico ">&#xe61f;</i></em><span<?php echo ($f == -1)?' class="zeaicolor"':'';?>>联系我们</span></a>
    </div>
    <img src="../res/m/img/agent1.png" class="sea">
</div>
<div class="clear"></div>



<div class="box ">
	<h1>线下优质会员<b></b>
        <h5>优质线下资源 • 高端约会场所</h5>
    </h1>
    <div class="iubtn"><a class="ed">推荐</a><a>男生</a><a>女生</a><a>更多</a></div>
    <div class="agent_detail_u"><?php if($ZEAI_totalP>0){echo Zeai_ajax_list_fn($ZEAI_totalP,$p);}else{echo $nodatatips;}?></div>
    <div class="clear"></div>
</div>


<style>
.hnlist{clear:both;overflow:auto;padding-top:10px}
.hnlist .nodatatips{width:50%}
.hnlist li{float:left;width:44%;margin:0 3% 20px 3%;text-align:center;position:relative;background-color:#fff;border:#eee 1px solid;box-shadow:0 1px 5px rgba(0,0,0,0.1);border-radius:10px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.hnlist li img{width:60%;display:block;border-radius:50%;box-sizing:border-box;margin:15px auto 5px auto}
.hnlist li h2{margin:10px auto;font-size:15px}
.hnlist li h4{margin:2px 0 10px 10px;color:#999;font-size:12px;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hnlist li:hover h2{color:#d8271c}
.hnlist li .add{text-align:center;width:90px;height:30px;line-height:30px;background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;color:#fff;font-size:12px;border-radius:22px;display:block;margin:0 auto 15px auto;position:relative}
.hnlist li .add i.ico{display:inline-block;font-size:12px;margin-right:3px}
.hnlist li .add:hover{background-color:#FF777B}
</style>
<div class="box " style="background-color:#fff;">
	<h1>专业红娘团队<b></b></h1>
    <h5>一对一会员服务，提供恋爱、婚姻、个人提升等全方位情感咨询服务</h5>
    <div id="list" class="hnlist">
        <?php 
        $rt=$db->query("SELECT id,sex,truename,path_s,title FROM ".__TBL_CRM_HN__." WHERE ifwebshow=1 AND flag=1 AND path_s<>'' ORDER BY px DESC LIMIT 4");
        $total = $db->num_rows($rt);
        if ($total > 0) {
            for($i=1;$i<=$total;$i++) {
                $rows = $db->fetch_array($rt,'name');
                if(!$rows)break;
                $id       = $rows['id'];
                $sex      = $rows['sex'];
                $truename = dataIO($rows['truename'],'out',7);
                $path_s   = $rows['path_s'];
                $title    = dataIO($rows['title'],'out');
                //$href     = 'detail.php?hid='.$hid;
                $path_s_url = (!empty($path_s))?UP.getpath_smb($path_s,'b'):RES.'photo_m'.$sex.'.png';
                $sexbg   = (empty($path_s))?' class="sexbg'.$sex.'"':'';
                ?>
                <li onClick="dtlhnFn(<?php echo $id;?>)"><img src="<?php echo $path_s_url; ?>"<?php echo $sexbg; ?>>
                    <h2><?php echo $truename; ?></h2>
                    <h4><?php echo $title; ?></h4>
                    <a class="add"><i class="ico">&#xe622;</i>委托服务</a>
                </li>
        		<?php
				if($i % 2 == 0)echo '<div class="clear"></div>';
				}}else{echo $nodatatips;}?>
    </div>
    <div class="clear"></div>
</div>



<style>
.iMarqueeBox{position:relative;height:220px;-webkit-user-select:none;-moz-user-select:none; }
.iMarqueeBox .iMarquee{position:absolute;left:0}
.iMarquee {width:100%;height:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.iMarquee li{width:100%;font-size:14px;height:38px;line-height:38px;color:#666;margin:1px 0;border-radius:20px;text-align:left;padding-left:10px;overflow:hidden;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.iMarquee li img,.iMarquee li font{display:inline-block;height:18px;line-height:18px;margin-top:5px;vertical-align:middle}
.iMarquee li img{width:18px;border-radius:10px;background-color:#FF6F6F;margin-right:5px;object-fit:cover;-webkit-object-fit:cover}
/*.iMarquee li font{width:-webkit-calc(100% - 30px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
*/.iMarquee li i{margin:0 10px;color:#FF6F6F;vertical-align:middle;font-size:18px;height:18px;line-height:18px;margin-top:5px}
</style>
<div class="box ">
	<h1>成功牵线案例<b></b></h1>
    <h5>定制高端猎婚 • 打造一流服务</h5>
    <div class="iMarqueeBox">
    <div id="iMarquee" class="iMarquee">
	<?php 
	$rt = $db->query("SELECT  a.senduid,a.uid,b.sex,b.nickname FROM ".__TBL_QIANXIAN__." a,".__TBL_USER__." b WHERE a.senduid=b.id ORDER BY a.id DESC LIMIT 15 ");//a.flag=2 AND 
	$total = $db->num_rows($rt);
	if ($total>0){
		for($i=1;$i<=$total;$i++) {
			$rows = $db->fetch_array($rt,'name');
			if(!$rows) break;
			$uid = $rows['uid'];
			$senduid = $rows['senduid'];
			
			//uid
			$row2 = $db->ROW(__TBL_USER__,"sex,grade,nickname,photo_s,photo_f","id=".$uid,"name");
			if ($row2){
				$sex2      = $row2['sex'];
				$grade2    = $row2['grade'];
				$photo_s2  = $row2['photo_s'];
				$photo_f2  = $row2['photo_f'];
				$nickname2 = dataIO($row2['nickname'],'out');
				$mob2      = dataIO($row2['mob'],'out');
				$weixin2   = dataIO($row2['weixin'],'out');
				$photo_s_url2 = (!empty($photo_s2) && $photo_f2==1)?UP.$photo_s2:RES.'photo_s'.$sex2.'.png';
			}
			
			
			$uid     = '*'.substr($uid,1,3).'*'.substr($uid,4,1).'*';
			$senduid = '*'.substr($senduid,1,3).'*'.substr($senduid,4,1).'*';
			$sex      = $rows['sex'];
			$photo_s  = $rows['photo_s'];
			$photo_f  = $rows['photo_f'];
			$photo_s_url = (!empty($photo_s) && $photo_f==1)?UP.$photo_s:RES.'photo_s'.$sex.'.png';
			echo '<li><font>恭喜会员</font> <img src="'.$photo_s_url.'"><font>'.$uid.'</font><i class="ico">&#xe635;</i><img src="'.$photo_s_url2.'"><font>'.$senduid.'</font> <font>牵线成功</font></li>';

		}
	}
	?>
    </div></div>
    <div class="clear"></div>
</div>
<script>
var zeai_iMarquee = function (id, tag, heigh, speed, delay) {
	var me = this;
	me.EL = document.getElementById(id);
	me.PA = 0;
	me.TI = null;
	me.LH = heigh;
	me.SP = speed;
	me.DY = delay;
	me.exec = function () {
		if (me.PA) return;
		me.EL.scrollTop += 2;
		if (me.EL.scrollTop % me.LH <= 1) {
			clearInterval(me.TI);
			me.EL.appendChild(me.EL.getElementsByTagName(tag)[0]);
			me.EL.scrollTop = 0;
			setTimeout(me.start, me.DY * 1000);
		}
	};
	me.start = function () {if (me.EL.scrollHeight - me.EL.offsetHeight >= me.LH) me.TI = setInterval(me.exec, me.SP);};
	setTimeout(me.start, me.DY * 1000);
};
function zeai_iMarqueeFn(){
	setTimeout(function(){new zeai_iMarquee("iMarquee","li",40,50,1);},100);
}
setTimeout(function(){zeai_iMarqueeFn();},2000);
</script>


<style>
.agent_detail_btm{width:100%;position:fixed;bottom:0;left:0;height:50px;border-top:#f0f0f0 1px solid;background-color:#fff;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);z-index:8}
.agent_detail_btm a{width:18%;float:left;height:50px;line-height:50px;color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.agent_detail_btm a:last-child{width:46%;}
.agent_detail_btm a:last-child span{width:120px;height:40px;line-height:40px;margin:5px auto 0 auto;border-radius:20px;background-color:<?php echo $_ZEAI['mob_mbcolor'];?>;color:#fff;font-size:16px;}
.agent_detail_btm a i{display:block;font-size:20px;line-height:20px;height:20px;margin-top:5px}
.agent_detail_btm a span{display:block;font-size:12px;color:#666;line-height:20px;height:20px}
.agent_detail_btm a.hui{background-color:#aaa}
</style>
<div id="agent_weixin_ewmBox" class="my-subscribe_box" style="display:none"><img src="<?php echo $ewm_url;?>"><h3>长按二维码添加客服微信</h3></div>
<div class="agent_detail_btm">
	<a href="<?php echo HOST;?>"><i class="ico">&#xe74e;</i><span>首页</span></a>
	<a href="tel:<?php echo $tel;?>"><i class="ico">&#xe7c1;</i><span>电话</span></a>
	<a onClick="ZeaiM.div({obj:agent_weixin_ewmBox,w:260,h:260});"><i class="ico">&#xe784;</i><span>客服</span></a>
	<a href="<?php echo HOST;?>/m/my_hongniang.php"><span class="ico">&#xe613; 我的红娘</span></a>
</div>
<div style="height:130px"></div>
</body>
</html>